package com.jk.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jk.dto.TemPosition;
import com.jk.dto.TemViewer;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Description 添加描述
 * @LastChangeDate 2025/2/13 10:42
 * @Version v1.0
 */
public interface TemPositionMapper extends BaseMapper<TemPosition>{
    IPage<TemPosition> findTemList(@Param(value = "temPosition") TemPosition temPosition, Page<TemPosition> page);

    //修改为招聘中
    @Update("update tem_position set state = '1' where id = #{id}")
    void updateStatus(Integer id);
    @Update("update tem_position set state = '0' , cause = #{cause} where id = #{id}")
    void updateState(TemPosition temPosition);

    void addTemViewer(TemViewer temViewer);

    @Delete("delete from tem_viewer where posts_id = #{id}")
    void delTemViewerById(Integer id);
    @Select("select * from tem_viewer where posts_id = #{id}")
    List<TemViewer> getTemById(Integer id);


}
